<!--{include(file='head.html')}-->
<script type="text/javascript" src="template/jslib/date/WdatePicker.js"></script>
<script type="text/javascript" src="template/jslib/tbox/tbox.js"></script>
<link rel="stylesheet" href="template/jslib/tbox/tbox.css" type="text/css" />
<div id="wrap">
	<!--{include('left.html')}-->
	<div id="maincont">
		<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
		<div id="main_c">
			<form name="seaform" id="seaform" action="<!--{url('admin','trade','item')}-->" method="post" onsubmit="$.oper.checkq('submit')">
				<div class="bt_bk">
					<span class="btn">
						<a href="javascript:void(0);" onclick="$.oper.refresh();return false;">刷新</a>
						<a href="javascript:void(0);" onclick="$.oper.remove();return false;">移除</a>
					</span>
					<span class="search_bk">
						从 <input type="text" class="input_tx short" value="<!--{if $time1}--><!--{date('Y-m-d H:i',$time1)}--><!--{/if}-->" name="time1" onclick="WdatePicker()" id="time1"/>
						到 <input type="text" class="input_tx short" value="<!--{if $time2}--><!--{date('Y-m-d H:i',$time2)}--><!--{/if}-->" name="time2" onclick="WdatePicker()" id="time2"/>
						<select name="qtype" class="select_tx">
							<option value="trade"		<!--{if $qtype == 'trade'}-->selected<!--{/if}-->	>订单</option>
							<option value="item"		<!--{if $qtype == 'item'}-->selected<!--{/if}-->	>商品</option>
						</select>
						<input type="text" class="input_tx <!--{if !$q}-->hintinput<!--{/if}-->" name="q" id="q" 
								value="<!--{def($q,'订单编号/商品（ID）')}-->" 
								onfocus="$.oper.checkq('focus')" onblur="$.oper.checkq('blur')"/>
						<input type="button" value="搜索" class="input_bt" onclick="$.oper.seasubmit('sea')"/>
						<input type="button" value="导出" class="input_bt" onclick="$.oper.seasubmit('import')"/>
					</span>
					<span class="state_tip"></span>
				</div>
				<input type="hidden" value="" name="do" id="do"/>
				<input type="hidden" value="<!--{def($pagearr['page'],1)}-->"		name="page" id="page"/>
				<input type="hidden" value="<!--{def($pagearr['pagesize'],10)}-->"	name="pagesize" id="pagesize" />
				<input type="hidden" value="<!--{$type}-->" name="type" id="type"/>
				<input type="hidden" value="<!--{$ordertime}-->" name="ordertime" id="ordertime"/>
			</form>
			<!--{include_page("page.html","top")}-->
			<div class="sn3">
				<select name="chgtime" onchange="seasubmit('ordertime',this.value)">
					<option value="0"  <!--{if !$ordertime}-->selected<!--{/if}-->>全部</option>
					<option value="30" <!--{if $ordertime == 30}-->selected<!--{/if}-->	>30天以内的订单</option>
					<option value="40" <!--{if $ordertime == 40}-->selected<!--{/if}--> >更早的订单</option>
				</select>
			</div>
			<div class="sn2">
				<a href="javascript:void(0)" id="a_all"		onclick="seasubmit('type','all');return false;"		
				<!--{if $type == "all"}-->class='on'<!--{/if}-->>全部</a>
				<a href="javascript:void(0)" id="a_wait_pay"		onclick="seasubmit('type','wait_pay');return false;"		
				<!--{if $type == "wait_pay"}-->class='on'<!--{/if}-->>未支付</a>
				<a href="javascript:void(0)" id="a_wait_send"		onclick="seasubmit('type','wait_send');return false;"		
				<!--{if $type == "wait_send"}-->class='on'<!--{/if}-->>待发货</a>
				<a href="javascript:void(0)" id="a_wait_rece"	onclick="seasubmit('type','wait_rece');return false;"		
				<!--{if $type == "wait_rece"}-->class='on'<!--{/if}-->>已发货</a>
				<a href="javascript:void(0)" id="a_finish"	onclick="seasubmit('type','finish');return false;"	
				<!--{if $type == "finish"}-->class='on'<!--{/if}-->>已完成</a>
				<a href="javascript:void(0)" id="a_cancel"	onclick="seasubmit('type','cancel');return false;"	
				<!--{if $type == "cancel"}-->class='on'<!--{/if}-->>已作废</a>
			</div>
			<table class="tableStyle" border="0" cellspacing="0" cellpadding="0">
				<thead>
					<tr align="center">
						<th width="10%">
							<input type="checkbox" value="1" name="allselect" id="allselect" autocomplete="off" onclick="$.oper.selectall()"/>
						</th>
						<th width="10%">操作</th>
						<th width="10%">订单编号</th>
						<th width="40%" colspan="2">商品</th>
						<th width="10%">价格（￥）</th>
						<th width="10%">数量</th>
						<th width="10%">下单时间</th>
					</tr>
				</thead>
				<tbody id="listtbody">
					<!--{foreach $tradeitems item}-->
					<tr align="center" id="tr_<!--{$item.tradeid}-->">
						<td><input type="checkbox" value="<!--{$item.tradeid}-->" name="singleselect" autocomplete="off"/></td>
						<td>
							<a href="javascript:void(0);" onclick="$.oper.remove('<!--{$item.tradeid}-->');return false;" class="remove"  title="移除"></a>
							<a href="javascript:void(0)" onclick="$.tbox.popup('<!--{url('admin','trade','tradeoper','opertype=view&tradeid=$item[tradeid]')}-->');return false;" class="detail"  title="详情"></a>
						</td>
						<td><!--{$item.tradeid}--></td>
						<td align="left" width="5%">
							<a href="<!--{url('index','item','index','itemid=$item[itemid]')}-->" class="tradeimg" target="_blank" title="<!--{$item['itemname']}-->">
								<img src="<!--{$item['itemimg']}-->_50x50.jpg" width="50" height="50" />
							</a>
						</td>
						<td align="left" width="35%">
							<!--{$item.itemname}-->
						</td>
						<td>
							<!--{getPrice($item.price)}-->
						</td>
						<td>
							<!--{$item.num}-->
						</td>
						<td><!--{date("m月d日 H:i",$item[addtime])}--></td>
					</tr>
					<!--{/foreach}-->
				</tbody>
			</table>
			<!--{include_page("page.html","foot")}-->
		</div>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
<!--{include(file='foot.html')}-->
<script type="text/javascript">
$(function(){
	$.oper.init("<!--{url('admin','trade','setdel')}-->").setdefq('订单编号/商品（ID）');
});
function seasubmit(field,value) {
	$("#"+field).val(value);
	if(field == "ordertime") {
		$("#time1,#time2").val('');
	}
	$("#seaform").submit();
}
</script>